<template>
	<view class="hotMovie">
		<movie-item v-for="(item,index) in hotMovieList" :key="index" :item="item" :m_list="hotMovieList"></movie-item>
	</view>
</template>
<script>
	import movieItem from "../../components/movieItem.vue";
	import request from "../../utils/request.js";
	export default {
		name: "hot",
		data() {
			return {
				hotMovieList: []
			}
		},
		created() {
			uni.showLoading({
				title: "正在加载"
			});

			request.get("https://www.softeem.xin/maoyanApi/ajax/movieOnInfoList").then(resp => {
				resp.data.movieList.forEach((item, index, a) => {
					item.img = item.img.replace("w.h", "128.180");
				});
				this.hotMovieList = resp.data.movieList;
				uni.hideLoading();
			}).catch(err=>{
				uni.hideLoading();
				uni.showToast({
					icon: "none",
					title: "加载失败"
				});
			});


		}, 
		components: {
			movieItem
		},
		methods: {

		}
	}
</script>
<style lang="scss" scoped>

</style>
